#ifndef DPGRAPHICSSCENE_H
#define DPGRAPHICSSCENE_H

#include <QtGui/QtGui>
#include <QtCore/QtCore>

class DPGraphicsItem;
class DPGameLogic;
class QStateMachine;

class DPGraphicsScene : public QGraphicsScene
{
    Q_OBJECT
public:
    DPGraphicsScene();
    virtual ~DPGraphicsScene();

    //void setGameLogic(DPGameLogic* gameLogic) { mGameLogic = gameLogic; }
    void  initGameLogic(const QString& cfgName);
    const QVector<QPixmap*>& getPixmapsState1() const { return mPixmapsState1; }
    const QVector<QPixmap*>& getPixmapsState2() const { return mPixmapsState2; }
    const QVector<QPixmap*>& getPixmapsState3() const { return mPixmapsState3; }
    QSize getItemSize() { return QSize(mItemWidth, mItemHeight); }
    QPointF getGamePos();
    int   getScore();
	float   getScoreEx();
public slots:
    void selectedChanged(DPGraphicsItem* item);
    void disappear();
    void fallOne();
    void disappearedOne();
    void updateMap();

	void finishedAnim(bool bForward = true);
signals:
    void stop();
    void start();
private:
    DPGraphicsItem*       mSelectedItem;
    DPGameLogic*          mGameLogic;
    QVector<QPixmap*>     mPixmapsState1;
    QVector<QPixmap*>     mPixmapsState2;
    QVector<QPixmap*>     mPixmapsState3;
    int          mItemWidth, mItemHeight;
    bool             mCanChangeItems;
	bool         mIsUpdateMap;
	bool         mIsDisappear;
    bool         mIsFallFinished;
};

#endif // DPGRAPHICSSCENE_H
